const mongoose = require('mongoose');

const schema = new mongoose.Schema({
    user: [{type: mongoose.Schema.Types.ObjectId, ref: 'User'}],
    chatType: {
        type: String,
        default: 'group',
        unmodifiable: true
    },
    message: [{
        poster: String,
        text: String,
        textType:  String,
        time: String,
    }]
})

module.exports = mongoose.model('groupMessage', schema);